{{define "title"}}
{{if .username}}
{{.username}} 在 {{.setting.Name}} 的全部评论
{{end}}
{{end}}
{{define "content"}}
<div class="row">
	<div class="col-md-9 col-sm-6">
		<div class="sep20"></div>
		<ol class="breadcrumb">
			<li><a href="/">首页</a></li>
			{{if .username}}
			<li><a href="/user/{{.username}}">{{.username}}</a></li>
			{{end}}
			<li class="active">全部评论</li>
		</ol>
		<div class="box_white recent recent-comments">
			<ul class="list-unstyled">
				{{range .comments}}
				<li>
					<div class="objinfo">
						<span class="info">
						{{if $.users}}
							{{with $user := index $.users .Uid}}
							<a href="/user/{{$user.Username}}">{{$user.Username}}</a>
							{{end}}
						{{end}}
							<abbr class="timeago" title="{{.Ctime}}"></abbr> 评论了<strong>{{.Objinfo.type_name}}</strong>
						</span>
						<a href="{{.Objinfo.uri}}{{.Objid}}" title="{{.Objinfo.title}}">{{substring .Objinfo.title 60 "..."}}</a>
					</div>
					<div class="content">
						<div class="md-content">{{substring .Content 100 "..."}}</div>
						
						<div style="font-size: 80%;text-align: center;">
							{{if eq .Objtype 0}}
							<a href="/topics/{{.Objid}}/comment/{{.Cid}}">查看详情</a>
							{{else if eq .Objtype 1}}
							<a href="/articles/{{.Objid}}/comment/{{.Cid}}">查看详情</a>
							{{end}}
						</div>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
		<div class="sep20"></div>
		{{if .page}}
		<div class="box_white">
			<div class="inner_content">
				<nav class="text-center"><ul class="pagination pagination-sm" style="margin: 1px 0;">{{.page}}</ul></nav>
			</div>
		</div>
		{{end}}
	</div>
	<div class="col-md-3 col-sm-6">
		<div class="sep20"></div>

		{{include "common/my_info.html" .}}
	
		{{if .username}}
		<div class="box_white sidebar">
			<div class="top">
				<h3 class="title"><i class="glyphicon glyphicon-list"></i>&nbsp;&nbsp;{{.username}} 分享的内容</h3>
			</div>
			<div class="sb-content">
				<div class="">
					<ul class="list-unstyled">
						<li style="margin-left:15px; margin-bottom:5px;"><a href="/user/{{.username}}/topics">{{.username}} 的全部主题</a></li>
						<li style="margin-left:15px; margin-bottom:5px;"><a href="/user/{{.username}}/articles">{{.username}} 的全部文章</a></li>
						<li style="margin-left:15px; margin-bottom:5px;"><a href="/user/{{.username}}/resources">{{.username}} 的全部资源</a></li>
						<li style="margin-left:15px; margin-bottom:5px;"><a href="/user/{{.username}}/comments">{{.username}} 的全部评论</a></li>
					</ul>
				</div>
			</div>
		</div>
		{{end}}
	</div>
</div>
{{end}}
{{define "css"}}

{{include "cssjs/prism.css.html" .}}

{{end}}
{{define "js"}}

{{include "cssjs/prism.js.html" .}}

<script type="text/javascript">
// 需要加载的侧边栏
SG.SIDE_BARS = [];

$(function() {
	$('.md-content').each(function() {
		var selector = $(this);
		var markdownString = selector.text();
		var marked = SG.markSettingNoHightlight();

		var contentHtml = marked(markdownString);
		contentHtml = SG.replaceCodeChar(contentHtml);
		
		selector.html(contentHtml);

		// emoji 表情解析
		emojify.run(selector.get(0));

		selector.find('code[class*="language-"]').parent('pre').addClass('line-numbers');

		Prism.highlightAll();
	});
});
</script>

{{end}}